package com.unionpay.upyzt.spring.example.config;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author yf.zhao
 * @version 1.0
 * @since 2020/8/27
 */
@Configuration
@EnableConfigurationProperties({UpyztProperties.class})
public class UpyztAutoConfiguration {

    @Bean
    public UpyztCustomizer upyztCustomizer(UpyztProperties upyztProperties) {
        return new UpyztCustomizer(upyztProperties);
    }

    @Bean
    public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
        return restTemplateBuilder.build();
    }

}
